using System;
using System.Collections;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ClassInterface, ComVisible(false), Guid("2561c0b9-92ab-464a-92ba-c7a3d727c6d0"), ProgId("BMC.ARSystem.ARForm")]
	public abstract class ARForm
	{
		[Guid("3b99163b-cc48-46d5-8147-5a7ae6f78f42")]
		public enum MemberFlags
		{
			Name = 1,
			NewName,
			FormType = 4,
			Permissions = 16,
			AdminGroups = 32,
			ResultListFields = 64,
			SortList = 128,
			IndexList = 256,
			Archive = 512,
			Audit = 1024,
			DefaultVui = 2048,
			HelpText = 4096,
			Owner = 8192,
			ChangeDiary = 16384,
			Properties = 32768,
			LastUpdateTime = 65536,
			LastModifiedBy = 131072,
			ModificationLogLabel = 262144,
			AssignedGroupList = 524288,
			AssignedName = 1048576
		}
		[ARStructMemTypeInfo(Name = "formName", Offset = 3u)]
		private string _name;
		[ARStructMemTypeInfo(Name = "permList", Offset = 6u)]
		private ArrayList _permList;
		[ARStructMemTypeInfo(Name = "assignedGroupList", Offset = 7u)]
		private ArrayList _assignedGroupList;
		[ARStructMemTypeInfo(Name = "adminGrpList", Offset = 8u)]
		private ArrayList _adminGrpList;
		[ARStructMemTypeInfo(Name = "getListFields", Offset = 9u)]
		private ArrayList _getListFields;
		[ARStructMemTypeInfo(Name = "sortList", Offset = 10u)]
		private ArrayList _sortList;
		[ARStructMemTypeInfo(Name = "indexList", Offset = 11u)]
		private ArrayList _indexList;
		private AuditInfo _auditInfo;
		private ArchiveInfo _archiveInfo;
		[ARStructMemTypeInfo(Name = "defaultVui", Offset = 13u)]
		private string _defaultVui;
		[ARStructMemTypeInfo(Name = "helpText", Offset = 14u)]
		private string _helpText;
		[ARStructMemTypeInfo(Name = "timestamp", Offset = 15u)]
		private DateTime _timestamp;
		[ARStructMemTypeInfo(Name = "owner", Offset = 16u)]
		private string _owner;
		[ARStructMemTypeInfo(Name = "lastChanged", Offset = 17u)]
		private string _lastChanged;
		[ARStructMemTypeInfo(Name = "changeDiary", Offset = 18u)]
		private DiaryList _changeDiary;
		[ARStructMemTypeInfo(Name = "objPropList", Offset = 19u)]
		private IDictionary _objPropList;
		[ARStructMemTypeInfo(Name = "modificationLogLabel", Offset = 20u)]
		private string _modificationLogLabel;
		[ARStructMemTypeInfo(Name = "assgnName", Offset = 21u)]
		private string _assgnName;
		private string _newName;
		private BitVector32 _modifyFlags;
		public string Name
		{
			get
			{
				return this._name;
			}
			set
			{
				this._name = value;
			}
		}
		public string NewName
		{
			get
			{
				return this._newName;
			}
			set
			{
				if (this._newName == value || this._newName == this._name)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2);
				this._newName = value;
			}
		}
		public ArrayList Permissions
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				return this._permList;
			}
			set
			{
				if (this._permList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16);
				this._permList = value;
			}
		}
		public ArrayList AssignedGroupList
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 524288);
				return this._assignedGroupList;
			}
			set
			{
				if (this._assignedGroupList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 524288);
				this._assignedGroupList = value;
			}
		}
		public AuditInfo AuditInformation
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1024);
				return this._auditInfo;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1024);
				this._auditInfo = value;
			}
		}
		public ArchiveInfo ArchiveInformation
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 512);
				return this._archiveInfo;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 512);
				this._archiveInfo = value;
			}
		}
		public string DefaultVui
		{
			get
			{
				return this._defaultVui;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 2048);
				this._defaultVui = value;
			}
		}
		public ArrayList AdminGroups
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32);
				return this._adminGrpList;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32);
				this._adminGrpList = value;
			}
		}
		public ArrayList ResultListFields
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 64);
				return this._getListFields;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 64);
				this._getListFields = value;
			}
		}
		public ArrayList SortList
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 128);
				return this._sortList;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 128);
				this._sortList = value;
			}
		}
		public ArrayList IndexList
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 256);
				return this._indexList;
			}
			set
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 256);
				this._indexList = value;
			}
		}
		public string HelpText
		{
			get
			{
				return this._helpText;
			}
			set
			{
				if (this._helpText == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 4096);
				this._helpText = value;
			}
		}
		public string Owner
		{
			get
			{
				return this._owner;
			}
			set
			{
				if (this._owner == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 8192);
				this._owner = value;
			}
		}
		public DiaryList ChangeDiary
		{
			get
			{
				return this._changeDiary;
			}
			set
			{
				if (this._changeDiary == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 16384);
				this._changeDiary = value;
			}
		}
		public IDictionary Properties
		{
			get
			{
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32768);
				return this._objPropList;
			}
			set
			{
				if (this._objPropList == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 32768);
				this._objPropList = value;
			}
		}
		public DateTime LastUpdateTime
		{
			get
			{
				return this._timestamp;
			}
		}
		public string LastModifiedBy
		{
			get
			{
				return this._lastChanged;
			}
		}
		public string ModificationLogLabel
		{
			get
			{
				return this._modificationLogLabel;
			}
			set
			{
				if (this._modificationLogLabel == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 262144);
				this._modificationLogLabel = value;
			}
		}
		public string AssignedName
		{
			get
			{
				return this._assgnName;
			}
			set
			{
				if (this._assgnName == value)
				{
					return;
				}
				this._modifyFlags = new BitVector32(this._modifyFlags.get_Data() | 1048576);
				this._assgnName = value;
			}
		}
		[ComVisible(false)]
		public BitVector32 MembersModified
		{
			get
			{
				return this._modifyFlags;
			}
			set
			{
				this._modifyFlags = value;
			}
		}
		public int MembersModifiedAsInt
		{
			get
			{
				return this._modifyFlags.get_Data();
			}
			set
			{
				this._modifyFlags = new BitVector32(value);
			}
		}
		protected ARForm()
		{
			this._modifyFlags = new BitVector32(0);
		}
		protected ARForm(string name) : this()
		{
			this.Name = name;
		}
		internal ARForm(object[] rawData, Server server)
		{
			this.Name = (string)Util.GetAt(rawData, new int[]
			{
				3
			});
			this.Permissions = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("Unknown"), (object[])Util.GetAt(rawData, new int[]
			{
				6
			}), server);
			this.AssignedGroupList = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("Unknown"), (object[])Util.GetAt(rawData, new int[]
			{
				7
			}), server);
			this.AdminGroups = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("System.UInt32"), (object[])Util.GetAt(rawData, new int[]
			{
				8
			}), server);
			this.ResultListFields = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("BMC.ARSystem.EntryListField"), (object[])Util.GetAt(rawData, new int[]
			{
				9
			}), server);
			this.SortList = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("Unknown"), (object[])Util.GetAt(rawData, new int[]
			{
				10
			}), server);
			this.IndexList = ARTypeMgr.Instance.ArrayListFromVariant(Type.GetType("BMC.ARSystem.Index"), (object[])Util.GetAt(rawData, new int[]
			{
				11
			}), server);
			this.ArchiveInformation = (ArchiveInfo)ARTypeMgr.Instance.ObjectFromVariant(typeof(ArchiveInfo), Util.GetAt(rawData, new int[]
			{
				12
			}), server);
			this.AuditInformation = (AuditInfo)ARTypeMgr.Instance.ObjectFromVariant(typeof(AuditInfo), Util.GetAt(rawData, new int[]
			{
				13
			}), server);
			this.DefaultVui = (string)Util.GetAt(rawData, new int[]
			{
				14
			});
			this.HelpText = (string)Util.GetAt(rawData, new int[]
			{
				15
			});
			this._timestamp = Util.GetDateTime(Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				16
			})));
			this.Owner = (string)Util.GetAt(rawData, new int[]
			{
				17
			});
			this._lastChanged = (string)Util.GetAt(rawData, new int[]
			{
				18
			});
			this.ChangeDiary = DiaryList.Decode((string)Util.GetAt(rawData, new int[]
			{
				19
			}));
			ARTypeMgr arg_2BD_0 = ARTypeMgr.Instance;
			Type arg_2BD_1 = typeof(HybridDictionary);
			string arg_2BD_2 = "System.Int32";
			int[] keyIndex = new int[1];
			this.Properties = arg_2BD_0.BuildCustomDictionaryFromVariant(arg_2BD_1, arg_2BD_2, keyIndex, "ARValue", new int[]
			{
				1
			}, (object[])Util.GetAt(rawData, new int[]
			{
				20
			}), server);
			this._modifyFlags = new BitVector32(1);
		}
		internal static ARForm createInstance(object[] rawData, Server server)
		{
			int[] array = new int[2];
			array[0] = 4;
			switch ((uint)Util.GetAt(rawData, array))
			{
			case 1u:
				return new RegularForm(rawData, server);
			case 2u:
				return new JoinForm(rawData, server);
			case 3u:
				return new ViewForm(rawData, server);
			case 4u:
				return new DisplayOnlyForm(rawData, server);
			case 5u:
				return new VendorForm(rawData, server);
			default:
				return new RegularForm();
			}
		}
	}
}
